<template>
  <el-form-item :label="label ? label + '：' : ''" :prop="prop">
    <el-input
      :value="value"
      :type="type"
      @input="inputChange($event)"
      :placeholder="place"
      :disabled="disabled"
    ></el-input>
  </el-form-item>
</template>

<script>
export default {
  props: {
    label: String,
    value: String,
    placeholder: String,
    prop: String,
    type: String,
    disabled: Boolean
  },
  data() {
    return {
      place: ""
    };
  },
  mounted() {
    this.initPlaceholder();
  },
  methods: {
    initPlaceholder() {
      this.place = this.placeholder || this.label;
    },
    inputChange(val) {
      this.$emit("input", val);
    }
  }
};
</script>
